import {getModelList} from '@/base/api/CouponsApi';

export class ProctutModelBloc {
  value: Array<any>=[];
  options: Array<any>=[];
  normalizedOptions:Array<any>=[];
  load() {
    return getModelList()
      .then((res) => {
        // @ts-ignore
        console.log(JSON.parse(res.data));
        // @ts-ignore
        let json = JSON.parse(res.data
          .replace(/categoryId/g, 'value')
          .replace(/sortName/g, 'label')
          .replace(/modelId/g, 'value')
          .replace(/modelName/g, 'label')
        );
        this.normalizedOptions = json.errMsg;
        return res;
      })
  }
}
